tests/tests_interactive/not_interactive_but_maybe_important/test.calculate.results 2.R

#library(ephys2)
library(devtools)
load_all()
#source("tests/tests_interactive/!setup_interactive_tests.R")
tr_<-get_treeinfo("VG_Blocker.dat")
tr<-reorder_tree(tr_,ephys2:::channels)
# bit of raw meat
attr(tr[[1]],'PLXLSfiles')<- list("VG_Blocker_1.xls") 


fake_selection<-function(tree, selected_indices){
  sel<-names(tree)[selected_indices[1]]
  for ( i in 2:length(selected_indices) ){
    sel<-c(sel, 
            names(tree[[sel]][selected_indices[i]])
    )
  }
  sel_<-sel[length(sel)]
  attr(sel_, "ancestry")<-sel[-length(sel) ]
  sel_
}
s127<-fake_selection(tr, c(1,2,7) )
s127
calculate.results(tr,list(s127),level = 2)

#experiments do  work with original tree :
e2<-fake_selection(tr_, c(1,1) )
e2
calculate.results(tr_,list(e2),level = 1)


#experiments do *not* work with reordered tree (see code):
e2<-fake_selection(tr, c(1,2) )
e2
calculate.results(tr,list(e2),level = 1) 




selection="something"
# showtree(tr)  will not work because of exisits("selection")
rm(selection)
tdanker/ephys2 documentation built on Aug. 11, 2019, 12:12 p.m.